#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H

#include <QApplication>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVideoWidget>
#include <QVBoxLayout>
#include <QWidget>
#include <QKeyEvent>
#include <QSlider>
#include <QTimer>
#include <QJsonDocument>
#include <QJsonObject>
#include<QJsonArray>
#include<QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include<QMessageBox>

class VideoPlayer : public QWidget {
    Q_OBJECT

public:
    VideoPlayer(QWidget *parent = nullptr);
    ~VideoPlayer();
    void keyPressEvent(QKeyEvent *event) override;
    bool eventFilter(QObject *obj, QEvent *event) override;
    void Play_mv(int mvid);
    void parseJson_mv(QByteArray byteArray);
    void close();
    void pasue();
    void play();
private slots:
    void updateSlider()
    {
        // 可以在这里添加逻辑以更新进度条
    }

    void replyFinished(QNetworkReply *reply);
private:
    QMediaPlayer *mv_player;
    QMediaPlaylist *mv_playlist;
    QVideoWidget *videoWidget;
    QSlider *mv_slider;
    QVBoxLayout *layout;
    QString mvUrl;//mv地址信息
    QNetworkAccessManager *mvUrl_manager;//mv地址请求管理
};




#endif // VIDEOPLAYER_H
